package com.sch.www.sys.feign.factory;


import com.sch.www.sys.feign.AccountApi;
import com.sch.www.sys.feign.fallback.AccountApiFallbackImpl;
import feign.hystrix.FallbackFactory;

/**
 * 用户断路器工厂
 *
 * @author tangyi
 * @date 2019/3/23 23:38
 */

public class UserServiceClientFallbackFactory implements FallbackFactory<AccountApi> {

    public UserServiceClientFallbackFactory() {

    }

    @Override
    public AccountApi create(Throwable throwable) {
        AccountApiFallbackImpl userServiceClientFallback = new AccountApiFallbackImpl();
        userServiceClientFallback.setThrowable(throwable);
        return userServiceClientFallback;
    }
}
